<template>
    <div>
        <p>计数器：{{ count }}</p>
        <button type="button" @click="add">加1</button>
    </div>
</template>

<script>
import {mapState,mapGetters,mapMutations,mapActions} from 'vuex';
export default {
    computed:{
      // ...mapState(["count"]),
      ...mapGetters(["count"]),
    },
    methods: {
        // ...mapMutations(["increment"]),
        ...mapActions(["increment"]),
        add() {
          // this.$store.commit("increment");
          this.increment(100);
        },
    },
};
</script>

<style>
</style>